home *** CD-ROM | disk | FTP | other *** search
- <WIZIF ItemIcons NEQ 2>
- <WIZSET IconImage1 = "Folder">
- <WIZELSE>
- <WIZSET IconImage1 = "Document">
- </WIZIF>
-
- <WIZIF ItemIcons EQ 0>
- <WIZSET IconImage2 = "Folder">
- <WIZELSE>
- <WIZSET IconImage2 = "Document">
- </WIZIF>
-
-
- <HTML><HEAD>
- <TITLE>$${ApplicationName} - $${RootItem}</TITLE>
- </HEAD><BODY bgcolor="ffffff">
-
-
- <FONT size="+1">$$ApplicationName</FONT> <BR>
- <FONT size="+2"><B>$${RootItem}</B></FONT>
-
- <P>
-
-
- <!---- group fields are the source for the tree? ---->
- <WIZIF TreeSourceType EQ '1'>
-
-
- <WIZSET QueryFieldList = ''>
- <WIZSET QueryOrderByList = ''>
- <WIZSET FieldCount = '0'>
- <WIZLOOP index="CurrentField" list="$${GroupFields}">
- <WIZSET FieldCount = FieldCount + 1>
- <!---- field is in format 'sTable.sField=sType;nSize;bRequired' ---->
- <WIZSET SeparatorPos = Find( CurrentField, '=' )>
- <WIZSET TableFieldName = Left( CurrentField, SeparatorPos - 1 )>
- <WIZSET QueryFieldList = QueryFieldList & TableFieldName & ' AS GroupField' & FieldCount & ', '>
- <WIZSET QueryOrderByList = QueryOrderByList & TableFieldName & ', '>
- </WIZLOOP>
- <WIZSET QueryFieldList = Left( QueryFieldList, Len(QueryFieldList) - 2 )>
- <WIZSET QueryOrderByList = Left( QueryOrderByList, Len(QueryOrderByList) - 2 )>
-
- <WIZSET QueryTableList = ''>
- <WIZLOOP index="i" list="$${Tables}">
- <WIZSET QueryTableList = QueryTableList & i & ', '>
- </WIZLOOP>
- <WIZSET QueryTableList = Left( QueryTableList, Len(QueryTableList) - 2 )>
-
- <WIZSET QueryJoinList = ''>
- <WIZLOOP index="i" list="$${Joins}">
- <WIZSET QueryJoinList = QueryJoinList & i & ' AND '>
- </WIZLOOP>
- <WIZIF QueryJoinList EQ ''>
- <WIZSET WhereClause = ''>
- <WIZELSE>
- <WIZSET WhereClause = 'WHERE ' & Left( QueryJoinList, Len(QueryJoinList) - 5 )>
- </WIZIF>
-
- <CFQUERY name="GetTreeData" dataSource="$${DataSource}">
- SELECT DISTINCT $${QueryFieldList}
- FROM $${QueryTableList}
- $${WhereClause}
- </CFQUERY>
-
-
- <CFFORM action="$${ActionURL}">
-
- <CFTREE name = "Tree"
- height = "600"
- width = "300"
- highlightRef = "no"
- >
-
- <CFSET GroupField0 = 0>
- <CFTREEITEM value="#GroupField0#" display="$${RootItem}" expand="yes">
-
- <CFSET CurGroup1 = "">
- <CFLOOP query="GetTreeData">
-
- <WIZLOOP index="i" from="1" to="$${FieldCount - 1}">
- <CFIF CurGroup$${i} is not GroupField$${i}>
- <CFTREEITEM value="#GroupField$${i}#" parent="#GroupField$${ i - 1 }#" display="#GroupField$${i}#" img="$${IconImage1}" expand="no">
- <CFSET CurGroup$${i} = GroupField$${i}>
- <CFSET CurGroup$${i+1} = ''>
- </CFIF>
- </WIZLOOP>
-
-
- <CFTREEITEM value="#GroupField$${FieldCount}#" parent="#GroupField$${ FieldCount - 1 }#" display="#GroupField$${FieldCount}#" img="$${IconImage2}" expand="no">
-
- </CFLOOP>
-
- </CFTREE>
-
- <P>
-
- <INPUT type="Submit" value="Open" name="btnOpen">
-
- </CFFORM>
-
-
-
- <!---- ...else ID and parentID fields are the source for the tree? ---->
- <WIZELSE>
-
- <WIZSET SeparatorPos = Find( IDField, '=' )>
- <WIZSET ItemID = Left( IDField, SeparatorPos - 1 )>
-
- <WIZSET SeparatorPos = Find( ParentIDField, '=' )>
- <WIZSET ParentItemID = Left( ParentIDField, SeparatorPos - 1 )>
-
- <CFQUERY name="GetTreeData" dataSource="$${DataSource}">
- SELECT $${ItemID} AS ItemID, $${ParentItemID} AS ParentItemID
- FROM $${Tables}
- </CFQUERY>
-
- <!--- If the CFX_MAKE_TREE tag extension is not installed on your server,
- you have to install it. The extension is available for download from
- CF_TagGallery at www.allaire.com --->
- <CFX_MAKE_TREE query="GetTreeData">
-
- <CFFORM action="$${ActionURL}">
-
- <CFTREE name = "Tree"
- height = "600"
- width = "300"
- highlightRef = "no"
- >
-
- <!--- use the parent ID of the first item in the recordset as the root ID --->
- <CFTREEITEM value="#GetTreeData.ParentItemID#" display="$${RootItem}" img="$${IconImage1}" expand="yes">
-
- <CFLOOP query="GetTreeData">
-
- <CFTREEITEM value="#ItemID#" parent="#ParentItemID#" display="#ItemID#" expand="no" img="$${IconImage2}">
-
- </CFLOOP>
-
- </CFTREE>
-
- <P>
-
- <INPUT type="Submit" value="Open" name="btnOpen">
-
- </CFFORM>
-
-
- </WIZIF>
-
-
- </BODY></HTML>